package net.apexcns.core.web.file;

import java.io.File;

import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;



public class FileItemFactory extends DiskFileItemFactory {
	public static final int DEFAULT_SIZE_THRESHOLD = 10240;
	private File repository;
	private int sizeThreshold;

	public FileItemFactory() {
		super();
	}

	public FileItemFactory(int sizeThreshold, File repository) {
		super(sizeThreshold, repository);
	}

	public FileItem createItem(String fieldName, String contentType,
			boolean isFormField, String fileName) {
		return new CmmFileItem(fieldName, contentType, isFormField, fileName,
				sizeThreshold, repository);
	}

}